package com.esteel.settlement.service;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.esteel.settlement.entity.TbSettAccount;
import com.esteel.settlement.pa.packet.Answer;
import com.esteel.settlement.pa.packet.RspBP1021;

/**
 * 签约结算系统的客户账户操作接口
 * @author zhangxiuzhi
 *
 */
public interface SettAccountService {

	public TbSettAccount save(TbSettAccount tbSettAccount);
	
	public void delete(TbSettAccount tbSettAccount);
	
	/**
	 * 分页查询账户信息
	 * @param pageable
	 * @return
	 */
	public Page<TbSettAccount> findAll(Pageable pageable);
	
	/**
	 * 
	 * @param custAcctId
	 * @return
	 */
	public TbSettAccount findByCustAcctId(String custAcctId);
	
	/**
	 * 根据会员号 查找会员账户表
	 * @param thirdCustId
	 * @return
	 */
	public TbSettAccount findByThirdCustId(String thirdCustId);

	/**
	 * 执行资金冻结与解冻操作
	 * @param funcFlag  1冻结  2解冻 标记
	 * @param custAcctId
	 * @param thirdCustId
	 * @param tranAmount
	 * @return 
	 */
	public Answer saveFreeze(int funcFlag,String custAcctId, String thirdCustId,double tranAmount);

	/**
	 * 执行收费与退费的操作
	 * @param funcFlag
	 * @param custAcctId
	 * @param thirdCustId
	 * @param tranAmount
	 * @return
	 */
	public Answer saveHee(int funcFlag, String custAcctId, String thirdCustId, double tranAmount);

	/**
	 * 平台支付与收取
	 * @param funcFlag
	 * @param custAcctId
	 * @param thirdCustId
	 * @param tranAmount
	 * @return
	 */
	public Answer saveSett(int funcFlag, String custAcctId, String thirdCustId, double tranAmount);

	/**
	 * 执行入金操作
	 * @param custAcctId
	 * @param thirdCustId
	 * @param tranAmount
	 * @return
	 */
	public Answer saveInMoney(String custAcctId, String thirdCustId, double tranAmount);

	/**
	 * 执行出金操作
	 * @param custAcctId
	 * @param thirdCustId
	 * @param tranAmount
	 * @return
	 */
	public Answer saveOutMoney(String custAcctId, String thirdCustId, double tranAmount); 
	
	
	/**
	 * 判断银行方给出的第三方账号是否合规
	 * @param thirdCustId
	 * @param orgCode 组织机构代码证
	 * @return -1:账户不存在 -2:组织机构代码证不正确 0:成功
	 */
	public int isExistThirdCustId(String thirdCustId,String orgCode);
	
	/**
	 * 查询银行端交易平台信息
	 * @return
	 */
	public RspBP1021 platInfo();
}
